<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>module Bundler - bundler: Ruby Standard Library Documentation</title>


<script src="./js/navigation.js" defer></script>
<script src="./js/search.js" defer></script>
<script src="./js/search_index.js" defer></script>
<script src="./js/searcher.js" defer></script>
<script src="./js/darkfish.js" defer></script>

<script src="./js/jquery-3.2.0.min.js"></script>

<script src="./js/vue.min.js"></script>
<script src="./js/js.cookie.min.js"></script>

<link href="./css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="./css/rdoc.css" rel="stylesheet">
<link href="./css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "./";
  var index_rel_prefix = "./";
  var darkModeCsseHref = "./css/rdoc-dm.css"
  var defaultModeCssHref = "./css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="module">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="./index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="./table_of_contents.html#pages">Pages</a>
    <a href="./table_of_contents.html#classes">Classes</a>
    <a href="./table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-URI">::URI</a>
    <li ><a href="#method-c-app_cache">::app_cache</a>
    <li ><a href="#method-c-app_config_path">::app_config_path</a>
    <li ><a href="#method-c-bin_path">::bin_path</a>
    <li ><a href="#method-c-bundle_path">::bundle_path</a>
    <li ><a href="#method-c-bundler_major_version">::bundler_major_version</a>
    <li ><a href="#method-c-clean_env">::clean_env</a>
    <li ><a href="#method-c-clean_exec">::clean_exec</a>
    <li ><a href="#method-c-clean_system">::clean_system</a>
    <li ><a href="#method-c-clear_gemspec_cache">::clear_gemspec_cache</a>
    <li ><a href="#method-c-configure">::configure</a>
    <li ><a href="#method-c-configure_gem_home">::configure_gem_home</a>
    <li ><a href="#method-c-configure_gem_home_and_path">::configure_gem_home_and_path</a>
    <li ><a href="#method-c-configure_gem_path">::configure_gem_path</a>
    <li ><a href="#method-c-configured_bundle_path">::configured_bundle_path</a>
    <li ><a href="#method-c-create_bundle_path">::create_bundle_path</a>
    <li ><a href="#method-c-current_ruby">::current_ruby</a>
    <li ><a href="#method-c-default_bundle_dir">::default_bundle_dir</a>
    <li ><a href="#method-c-default_gemfile">::default_gemfile</a>
    <li ><a href="#method-c-default_lockfile">::default_lockfile</a>
    <li ><a href="#method-c-definition">::definition</a>
    <li ><a href="#method-c-environment">::environment</a>
    <li ><a href="#method-c-eval_gemspec">::eval_gemspec</a>
    <li ><a href="#method-c-eval_yaml_gemspec">::eval_yaml_gemspec</a>
    <li ><a href="#method-c-feature_flag">::feature_flag</a>
    <li ><a href="#method-c-frozen_bundle-3F">::frozen_bundle?</a>
    <li ><a href="#method-c-gem_version">::gem_version</a>
    <li ><a href="#method-c-git_present-3F">::git_present?</a>
    <li ><a href="#method-c-home">::home</a>
    <li ><a href="#method-c-install_path">::install_path</a>
    <li ><a href="#method-c-load">::load</a>
    <li ><a href="#method-c-load_gemspec">::load_gemspec</a>
    <li ><a href="#method-c-load_gemspec_uncached">::load_gemspec_uncached</a>
    <li ><a href="#method-c-load_marshal">::load_marshal</a>
    <li ><a href="#method-c-local_platform">::local_platform</a>
    <li ><a href="#method-c-locked_gems">::locked_gems</a>
    <li ><a href="#method-c-mkdir_p">::mkdir_p</a>
    <li ><a href="#method-c-most_specific_locked_platform-3F">::most_specific_locked_platform?</a>
    <li ><a href="#method-c-original_env">::original_env</a>
    <li ><a href="#method-c-original_exec">::original_exec</a>
    <li ><a href="#method-c-original_system">::original_system</a>
    <li ><a href="#method-c-preferred_gemfile_name">::preferred_gemfile_name</a>
    <li ><a href="#method-c-read_file">::read_file</a>
    <li ><a href="#method-c-require">::require</a>
    <li ><a href="#method-c-require_thor_actions">::require_thor_actions</a>
    <li ><a href="#method-c-reset-21">::reset!</a>
    <li ><a href="#method-c-reset_paths-21">::reset_paths!</a>
    <li ><a href="#method-c-reset_rubygems-21">::reset_rubygems!</a>
    <li ><a href="#method-c-reset_settings_and_root-21">::reset_settings_and_root!</a>
    <li ><a href="#method-c-rm_rf">::rm_rf</a>
    <li ><a href="#method-c-root">::root</a>
    <li ><a href="#method-c-ruby_scope">::ruby_scope</a>
    <li ><a href="#method-c-rubygems">::rubygems</a>
    <li ><a href="#method-c-safe_load_marshal">::safe_load_marshal</a>
    <li ><a href="#method-c-self_manager">::self_manager</a>
    <li ><a href="#method-c-settings">::settings</a>
    <li ><a href="#method-c-setup">::setup</a>
    <li ><a href="#method-c-specs_path">::specs_path</a>
    <li ><a href="#method-c-system_bindir">::system_bindir</a>
    <li ><a href="#method-c-tmp">::tmp</a>
    <li ><a href="#method-c-tmp_home_path">::tmp_home_path</a>
    <li ><a href="#method-c-ui">::ui</a>
    <li ><a href="#method-c-ui-3D">::ui=</a>
    <li ><a href="#method-c-unbundled_env">::unbundled_env</a>
    <li ><a href="#method-c-unbundled_exec">::unbundled_exec</a>
    <li ><a href="#method-c-unbundled_system">::unbundled_system</a>
    <li ><a href="#method-c-use_system_gems-3F">::use_system_gems?</a>
    <li ><a href="#method-c-user_bundle_path">::user_bundle_path</a>
    <li ><a href="#method-c-user_cache">::user_cache</a>
    <li ><a href="#method-c-user_home">::user_home</a>
    <li ><a href="#method-c-which">::which</a>
    <li ><a href="#method-c-with_clean_env">::with_clean_env</a>
    <li ><a href="#method-c-with_env">::with_env</a>
    <li ><a href="#method-c-with_friendly_errors">::with_friendly_errors</a>
    <li ><a href="#method-c-with_original_env">::with_original_env</a>
    <li ><a href="#method-c-with_unbundled_env">::with_unbundled_env</a>
    <li ><a href="#method-i-URI">#URI</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="module-Bundler">
    <h1 id="module-Bundler" class="module">
      module Bundler
    </h1>

    <section class="description">
    
<p><a href="Bundler.html"><code>Bundler</code></a> provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed.</p>

<p>Since Ruby 2.6, <a href="Bundler.html"><code>Bundler</code></a> is a part of Ruby’s standard library.</p>

<p><a href="Bundler.html"><code>Bundler</code></a> is used by creating <em>gemfiles</em> listing all the project dependencies and (optionally) their versions and then using</p>

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;bundler/setup&#39;</span>
</pre>

<p>or <a href="Bundler.html#method-c-setup"><code>Bundler.setup</code></a> to setup environment where only specified gems and their specified versions could be used.</p>

<p>See <a href="https://bundler.io/docs.html">Bundler website</a> for extensive documentation on gemfiles creation and <a href="Bundler.html"><code>Bundler</code></a> usage.</p>

<p>As a standard library inside project, <a href="Bundler.html"><code>Bundler</code></a> could be used for introspection of loaded and required modules.</p>

<p>This code was extracted from <a href="https://github.com/Solistra/ruby-digest">github.com/Solistra/ruby-digest</a> which is under public domain</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="Deprecate">Deprecate
          <dd>
          <dt id="FREEBSD">FREEBSD
          <dd>
          <dt id="NULL">NULL
          <dd>
          <dt id="ORIGINAL_ENV">ORIGINAL_ENV
          <dd>
          <dt id="PersistentHTTP">PersistentHTTP
          <dd>
          <dt id="SUDO_MUTEX">SUDO_MUTEX
          <dd>
          <dt id="VERSION">VERSION
          <dd>
          <dt id="WINDOWS">WINDOWS
          <dd>
        </dl>
        </section>



                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-URI" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">URI</span><span
                                class="method-args">(uri)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns <code>uri</code> converted to an <a href="Bundler/URI.html"><code>Bundler::URI</code></a> object.</p>

                              <div class="method-source-code" id="URI-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 718</span>
<span class="ruby-keyword">def</span> <span class="ruby-constant">URI</span>(<span class="ruby-identifier ruby-title">uri</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">Generic</span>)
    <span class="ruby-identifier">uri</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">uri</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">try_convert</span>(<span class="ruby-identifier">uri</span>)
    <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>,
      <span class="ruby-string">&quot;bad argument (expected Bundler::URI object or Bundler::URI string)&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-app_cache" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">app_cache</span><span
                                class="method-args">(custom_path = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="app_cache-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 321</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">app_cache</span>(<span class="ruby-identifier">custom_path</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">path</span> = <span class="ruby-identifier">custom_path</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">root</span>
  <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">join</span>(<span class="ruby-identifier">settings</span>.<span class="ruby-identifier">app_cache_path</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-app_config_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">app_config_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="app_config_path-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 307</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">app_config_path</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">app_config</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;BUNDLE_APP_CONFIG&quot;</span>]
    <span class="ruby-identifier">app_config_pathname</span> = <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">app_config</span>)

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">app_config_pathname</span>.<span class="ruby-identifier">absolute?</span>
      <span class="ruby-identifier">app_config_pathname</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">app_config_pathname</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">root</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">root</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;.bundle&quot;</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-bin_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">bin_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns absolute location of where binstubs are installed to.</p>

                              <div class="method-source-code" id="bin_path-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 116</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">bin_path</span>
  <span class="ruby-ivar">@bin_path</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
    <span class="ruby-identifier">path</span> = <span class="ruby-identifier">settings</span>[<span class="ruby-value">:bin</span>] <span class="ruby-operator">||</span> <span class="ruby-string">&quot;bin&quot;</span>
    <span class="ruby-identifier">path</span> = <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">root</span>).<span class="ruby-identifier">expand_path</span>
    <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-identifier">path</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">p</span>) }
    <span class="ruby-identifier">path</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-bundle_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">bundle_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns absolute path of where gems are installed on the filesystem.</p>

                              <div class="method-source-code" id="bundle_path-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 96</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">bundle_path</span>
  <span class="ruby-ivar">@bundle_path</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">configured_bundle_path</span>.<span class="ruby-identifier">path</span>).<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">root</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-bundler_major_version" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">bundler_major_version</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="bundler_major_version-source">
            <pre><span class="ruby-comment"># File bundler/version.rb, line 6</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">bundler_major_version</span>
  <span class="ruby-ivar">@bundler_major_version</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">VERSION</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;.&quot;</span>).<span class="ruby-identifier">first</span>.<span class="ruby-identifier">to_i</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-clean_env" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clean_env</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>@deprecated Use ‘unbundled_env` instead</p>

                              <div class="method-source-code" id="clean_env-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 355</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clean_env</span>
  <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">major_deprecation</span>(
    <span class="ruby-value">2</span>,
    <span class="ruby-string">&quot;`Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. &quot;</span> \
    <span class="ruby-string">&quot;If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`&quot;</span>,
    <span class="ruby-value">:print_caller_location</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-keyword">true</span>
  )

  <span class="ruby-identifier">unbundled_env</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-clean_exec" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clean_exec</span><span
                                class="method-args">(*args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>@deprecated Use ‘unbundled_exec` instead</p>

                              <div class="method-source-code" id="clean_exec-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 442</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clean_exec</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
  <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">major_deprecation</span>(
    <span class="ruby-value">2</span>,
    <span class="ruby-string">&quot;`Bundler.clean_exec` has been deprecated in favor of `Bundler.unbundled_exec`. &quot;</span> \
    <span class="ruby-string">&quot;If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec`&quot;</span>,
    <span class="ruby-value">:print_caller_location</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-keyword">true</span>
  )

  <span class="ruby-identifier">with_env</span>(<span class="ruby-identifier">unbundled_env</span>) { <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">exec</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-clean_system" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clean_system</span><span
                                class="method-args">(*args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>@deprecated Use ‘unbundled_system` instead</p>

                              <div class="method-source-code" id="clean_system-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 420</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clean_system</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
  <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">major_deprecation</span>(
    <span class="ruby-value">2</span>,
    <span class="ruby-string">&quot;`Bundler.clean_system` has been deprecated in favor of `Bundler.unbundled_system`. &quot;</span> \
    <span class="ruby-string">&quot;If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system`&quot;</span>,
    <span class="ruby-value">:print_caller_location</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-keyword">true</span>
  )

  <span class="ruby-identifier">with_env</span>(<span class="ruby-identifier">unbundled_env</span>) { <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">system</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-clear_gemspec_cache" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clear_gemspec_cache</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="clear_gemspec_cache-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 548</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clear_gemspec_cache</span>
  <span class="ruby-ivar">@gemspec_cache</span> = {}
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-configure" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">configure</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="configure-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 82</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">configure</span>
  <span class="ruby-ivar">@configure</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">configure_gem_home_and_path</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-configure_gem_home_and_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">configure_gem_home_and_path</span><span
                                class="method-args">(path = bundle_path)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="configure_gem_home_and_path-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 594</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">configure_gem_home_and_path</span>(<span class="ruby-identifier">path</span> = <span class="ruby-identifier">bundle_path</span>)
  <span class="ruby-identifier">configure_gem_path</span>
  <span class="ruby-identifier">configure_gem_home</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">clear_paths</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-configured_bundle_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">configured_bundle_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="configured_bundle_path-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 111</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">configured_bundle_path</span>
  <span class="ruby-ivar">@configured_bundle_path</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">settings</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">tap</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:validate!</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-create_bundle_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">create_bundle_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="create_bundle_path-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 100</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">create_bundle_path</span>
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-identifier">bundle_path</span>.<span class="ruby-identifier">to_s</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">p</span>)
  <span class="ruby-keyword">end</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">bundle_path</span>.<span class="ruby-identifier">exist?</span>

  <span class="ruby-ivar">@bundle_path</span> = <span class="ruby-identifier">bundle_path</span>.<span class="ruby-identifier">realpath</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EEXIST</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">PathError</span>, <span class="ruby-node">&quot;Could not install to path `#{bundle_path}` &quot;</span> \
    <span class="ruby-string">&quot;because a file already exists at that path. Either remove or rename the file so the directory can be created.&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-current_ruby" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">current_ruby</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns current version of Ruby</p>

<p>@return [CurrentRuby] Current version of Ruby</p>

                              <div class="method-source-code" id="current_ruby-source">
            <pre><span class="ruby-comment"># File bundler/current_ruby.rb, line 7</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">current_ruby</span>
  <span class="ruby-ivar">@current_ruby</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">CurrentRuby</span>.<span class="ruby-identifier">new</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-default_bundle_dir" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">default_bundle_dir</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="default_bundle_dir-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 471</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">default_bundle_dir</span>
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">default_bundle_dir</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-default_gemfile" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">default_gemfile</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="default_gemfile-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 463</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">default_gemfile</span>
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">default_gemfile</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-default_lockfile" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">default_lockfile</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="default_lockfile-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 467</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">default_lockfile</span>
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">default_lockfile</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-definition" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">definition</span><span
                                class="method-args">(unlock = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns an instance of <a href="Bundler/Definition.html"><code>Bundler::Definition</code></a> for given Gemfile and lockfile</p>

<p>@param unlock [Hash, Boolean, nil] Gems that have been requested</p>

<pre class="ruby"><span class="ruby-identifier">to</span> <span class="ruby-identifier">be</span> <span class="ruby-identifier">updated</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">all</span> <span class="ruby-identifier">gems</span> <span class="ruby-identifier">should</span> <span class="ruby-identifier">be</span> <span class="ruby-identifier">updated</span>
</pre>

<p>@return [Bundler::Definition]</p>

                              <div class="method-source-code" id="definition-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 204</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">definition</span>(<span class="ruby-identifier">unlock</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-ivar">@definition</span> = <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">unlock</span>
  <span class="ruby-ivar">@definition</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
    <span class="ruby-identifier">configure</span>
    <span class="ruby-constant">Definition</span>.<span class="ruby-identifier">build</span>(<span class="ruby-identifier">default_gemfile</span>, <span class="ruby-identifier">default_lockfile</span>, <span class="ruby-identifier">unlock</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-environment" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">environment</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="environment-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 194</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">environment</span>
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">major_deprecation</span> <span class="ruby-value">2</span>, <span class="ruby-string">&quot;Bundler.environment has been removed in favor of Bundler.load&quot;</span>, <span class="ruby-value">:print_caller_location</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-keyword">true</span>
  <span class="ruby-identifier">load</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-feature_flag" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">feature_flag</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="feature_flag-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 557</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">feature_flag</span>
  <span class="ruby-ivar">@feature_flag</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">FeatureFlag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">VERSION</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-frozen_bundle-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">frozen_bundle?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="frozen_bundle-3F-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 212</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">frozen_bundle?</span>
  <span class="ruby-identifier">frozen</span> = <span class="ruby-identifier">settings</span>[<span class="ruby-value">:frozen</span>]
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">frozen</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">frozen</span>.<span class="ruby-identifier">nil?</span>

  <span class="ruby-identifier">settings</span>[<span class="ruby-value">:deployment</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-gem_version" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">gem_version</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="gem_version-source">
            <pre><span class="ruby-comment"># File bundler/version.rb, line 10</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">gem_version</span>
  <span class="ruby-ivar">@gem_version</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Version</span>.<span class="ruby-identifier">create</span>(<span class="ruby-constant">VERSION</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-git_present-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">git_present?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="git_present-3F-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 552</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">git_present?</span>
  <span class="ruby-keyword">return</span> <span class="ruby-ivar">@git_present</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-ivar">@git_present</span>)
  <span class="ruby-ivar">@git_present</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">which</span>(<span class="ruby-node">&quot;git#{RbConfig::CONFIG[&quot;EXEEXT&quot;]}&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-home" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">home</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="home-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 285</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">home</span>
  <span class="ruby-identifier">bundle_path</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;bundler&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-install_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="install_path-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 289</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_path</span>
  <span class="ruby-identifier">home</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;gems&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-load" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">load</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="load-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 190</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load</span>
  <span class="ruby-ivar">@load</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Runtime</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">root</span>, <span class="ruby-identifier">definition</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-load_gemspec" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">load_gemspec</span><span
                                class="method-args">(file, validate = false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="load_gemspec-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 521</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load_gemspec</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">validate</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-ivar">@gemspec_cache</span> <span class="ruby-operator">||=</span> {}
  <span class="ruby-identifier">key</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">file</span>)
  <span class="ruby-ivar">@gemspec_cache</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">load_gemspec_uncached</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">validate</span>)
  <span class="ruby-comment"># Protect against caching side-effected gemspecs by returning a</span>
  <span class="ruby-comment"># new instance each time.</span>
  <span class="ruby-ivar">@gemspec_cache</span>[<span class="ruby-identifier">key</span>]&amp;.<span class="ruby-identifier">dup</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-load_gemspec_uncached" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">load_gemspec_uncached</span><span
                                class="method-args">(file, validate = false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="load_gemspec_uncached-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 530</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load_gemspec_uncached</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">validate</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-identifier">path</span> = <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">file</span>)
  <span class="ruby-identifier">contents</span> = <span class="ruby-identifier">read_file</span>(<span class="ruby-identifier">file</span>)
  <span class="ruby-identifier">spec</span> = <span class="ruby-keyword">if</span> <span class="ruby-identifier">contents</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot;---&quot;</span>) <span class="ruby-comment"># YAML header</span>
    <span class="ruby-identifier">eval_yaml_gemspec</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">contents</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-comment"># Eval the gemspec from its parent directory, because some gemspecs</span>
    <span class="ruby-comment"># depend on &quot;./&quot; relative paths.</span>
    <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">chdir</span>(<span class="ruby-identifier">path</span>.<span class="ruby-identifier">dirname</span>.<span class="ruby-identifier">to_s</span>) <span class="ruby-keyword">do</span>
      <span class="ruby-identifier">eval_gemspec</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">contents</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">spec</span>
  <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">loaded_from</span> = <span class="ruby-identifier">path</span>.<span class="ruby-identifier">expand_path</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-identifier">spec</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">validate</span>
  <span class="ruby-identifier">spec</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-local_platform" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">local_platform</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="local_platform-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 458</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">local_platform</span>
  <span class="ruby-keyword">return</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span><span class="ruby-operator">::</span><span class="ruby-constant">RUBY</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">settings</span>[<span class="ruby-value">:force_ruby_platform</span>]
  <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span>.<span class="ruby-identifier">local</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-locked_gems" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">locked_gems</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="locked_gems-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 219</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">locked_gems</span>
  <span class="ruby-ivar">@locked_gems</span> <span class="ruby-operator">||=</span>
    <span class="ruby-keyword">if</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-ivar">@definition</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@definition</span>
      <span class="ruby-identifier">definition</span>.<span class="ruby-identifier">locked_gems</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">default_lockfile</span>.<span class="ruby-identifier">file?</span>
      <span class="ruby-identifier">lock</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">read_file</span>(<span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">default_lockfile</span>)
      <span class="ruby-constant">LockfileParser</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">lock</span>)
    <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-mkdir_p" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">mkdir_p</span><span
                                class="method-args">(path, options = {})</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="mkdir_p-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 492</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">mkdir_p</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-identifier">path</span>, <span class="ruby-value">:write</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
    <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">p</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-most_specific_locked_platform-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">most_specific_locked_platform?</span><span
                                class="method-args">(platform)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="most_specific_locked_platform-3F-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 229</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">most_specific_locked_platform?</span>(<span class="ruby-identifier">platform</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-ivar">@definition</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@definition</span>

  <span class="ruby-identifier">definition</span>.<span class="ruby-identifier">most_specific_locked_platform</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">platform</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-original_env" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">original_env</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>@return [Hash] Environment present before <a href="Bundler.html"><code>Bundler</code></a> was activated</p>

                              <div class="method-source-code" id="original_env-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 350</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">original_env</span>
  <span class="ruby-constant">ORIGINAL_ENV</span>.<span class="ruby-identifier">clone</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-original_exec" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">original_exec</span><span
                                class="method-args">(*args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Run a ‘Kernel.exec` to a subcommand with the environment present before <a href="Bundler.html"><code>Bundler</code></a> was activated</p>

                              <div class="method-source-code" id="original_exec-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 437</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">original_exec</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
  <span class="ruby-identifier">with_original_env</span> { <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">exec</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-original_system" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">original_system</span><span
                                class="method-args">(*args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Run subcommand with the environment present before <a href="Bundler.html"><code>Bundler</code></a> was activated</p>

                              <div class="method-source-code" id="original_system-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 415</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">original_system</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
  <span class="ruby-identifier">with_original_env</span> { <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">system</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-preferred_gemfile_name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">preferred_gemfile_name</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="preferred_gemfile_name-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 484</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">preferred_gemfile_name</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:init_gems_rb</span>] <span class="ruby-operator">?</span> <span class="ruby-string">&quot;gems.rb&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-string">&quot;Gemfile&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-read_file" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">read_file</span><span
                                class="method-args">(file)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="read_file-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 511</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">read_file</span>(<span class="ruby-identifier">file</span>)
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-identifier">file</span>, <span class="ruby-value">:read</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file</span>, <span class="ruby-string">&quot;r:UTF-8&quot;</span>, <span class="ruby-operator">&amp;</span><span class="ruby-value">:read</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-require" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">require</span><span
                                class="method-args">(*groups)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Setups <a href="Bundler.html"><code>Bundler</code></a> environment (see <a href="Bundler.html#method-c-setup"><code>Bundler.setup</code></a>) if it is not already set, and loads all gems from groups specified. Unlike <a href="Bundler.html#method-c-setup"><code>::setup</code></a>, can be called multiple times with different groups (if they were allowed by setup).</p>

<p>Assuming Gemfile</p>

<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-string">&#39;first_gem&#39;</span>, <span class="ruby-string">&#39;= 1.0&#39;</span>
<span class="ruby-identifier">group</span> <span class="ruby-value">:test</span> <span class="ruby-keyword">do</span>
  <span class="ruby-identifier">gem</span> <span class="ruby-string">&#39;second_gem&#39;</span>, <span class="ruby-string">&#39;= 1.0&#39;</span>
<span class="ruby-keyword">end</span>
</pre>

<p>The code will work as follows:</p>

<pre class="ruby"><span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">setup</span> <span class="ruby-comment"># allow all groups</span>
<span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">require</span>(<span class="ruby-value">:default</span>) <span class="ruby-comment"># requires only first_gem</span>
<span class="ruby-comment"># ...later</span>
<span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">require</span>(<span class="ruby-value">:test</span>)   <span class="ruby-comment"># requires second_gem</span>
</pre>

                              <div class="method-source-code" id="require-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 186</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">require</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">groups</span>)
  <span class="ruby-identifier">setup</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">groups</span>).<span class="ruby-identifier">require</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">groups</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-require_thor_actions" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">require_thor_actions</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="require_thor_actions-source">
            <pre><span class="ruby-comment"># File bundler/vendored_thor.rb, line 4</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">require_thor_actions</span>
  <span class="ruby-identifier">require_relative</span> <span class="ruby-string">&quot;vendor/thor/lib/thor/actions&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-reset-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reset!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="reset-21-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 561</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reset!</span>
  <span class="ruby-identifier">reset_paths!</span>
  <span class="ruby-constant">Plugin</span>.<span class="ruby-identifier">reset!</span>
  <span class="ruby-identifier">reset_rubygems!</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-reset_paths-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reset_paths!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="reset_paths-21-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 572</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reset_paths!</span>
  <span class="ruby-ivar">@bin_path</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@bundler_major_version</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@bundle_path</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@configure</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@configured_bundle_path</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@definition</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@load</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@locked_gems</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@root</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@settings</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@setup</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@user_home</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-reset_rubygems-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reset_rubygems!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="reset_rubygems-21-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 587</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reset_rubygems!</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-ivar">@rubygems</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@rubygems</span>
  <span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">undo_replacements</span>
  <span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">reset</span>
  <span class="ruby-ivar">@rubygems</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-reset_settings_and_root-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reset_settings_and_root!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="reset_settings_and_root-21-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 567</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reset_settings_and_root!</span>
  <span class="ruby-ivar">@settings</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@root</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-rm_rf" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">rm_rf</span><span
                                class="method-args">(path)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="rm_rf-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 331</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">rm_rf</span>(<span class="ruby-identifier">path</span>)
      <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">remove_entry_secure</span>(<span class="ruby-identifier">path</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">path</span>)
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">ArgumentError</span>
      <span class="ruby-identifier">message</span> = <span class="ruby-identifier">&lt;&lt;EOF</span>
<span class="ruby-value">It is a security vulnerability to allow your home directory to be world-writable, and bundler cannot continue.
You should probably consider fixing this issue by running `chmod o-w ~` on *nix.
Please refer to https://ruby-doc.org/stdlib-3.1.2/libdoc/fileutils/rdoc/FileUtils.html#method-c-remove_entry_secure for details.
</span><span class="ruby-identifier">EOF</span>
      <span class="ruby-constant">File</span>.<span class="ruby-identifier">world_writable?</span>(<span class="ruby-identifier">path</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-identifier">message</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">raise</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">PathError</span>, <span class="ruby-node">&quot;Please fix the world-writable issue with your #{path} directory&quot;</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-root" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">root</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="root-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 297</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">root</span>
  <span class="ruby-ivar">@root</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
              <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">root</span>
            <span class="ruby-keyword">rescue</span> <span class="ruby-constant">GemfileNotFound</span>
              <span class="ruby-identifier">bundle_dir</span> = <span class="ruby-identifier">default_bundle_dir</span>
              <span class="ruby-identifier">raise</span> <span class="ruby-constant">GemfileNotFound</span>, <span class="ruby-string">&quot;Could not locate Gemfile or .bundle/ directory&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">bundle_dir</span>
              <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">&quot;..&quot;</span>, <span class="ruby-identifier">bundle_dir</span>))
            <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-ruby_scope" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ruby_scope</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ruby_scope-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 235</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ruby_scope</span>
  <span class="ruby-node">&quot;#{Bundler.rubygems.ruby_engine}/#{RbConfig::CONFIG[&quot;ruby_version&quot;]}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-rubygems" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">rubygems</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="rubygems-source">
            <pre><span class="ruby-comment"># File bundler/rubygems_integration.rb, line 602</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">rubygems</span>
  <span class="ruby-ivar">@rubygems</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">RubygemsIntegration</span>.<span class="ruby-identifier">new</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-safe_load_marshal" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">safe_load_marshal</span><span
                                class="method-args">(data)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="safe_load_marshal-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 517</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">safe_load_marshal</span>(<span class="ruby-identifier">data</span>)
  <span class="ruby-identifier">load_marshal</span>(<span class="ruby-identifier">data</span>, <span class="ruby-value">:marshal_proc</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-constant">SafeMarshal</span>.<span class="ruby-identifier">proc</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-self_manager" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">self_manager</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="self_manager-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 600</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">self_manager</span>
  <span class="ruby-ivar">@self_manager</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
                      <span class="ruby-identifier">require_relative</span> <span class="ruby-string">&quot;bundler/self_manager&quot;</span>
                      <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">SelfManager</span>.<span class="ruby-identifier">new</span>
                    <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-settings" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">settings</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="settings-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 343</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">settings</span>
  <span class="ruby-ivar">@settings</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Settings</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">app_config_path</span>)
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">GemfileNotFound</span>
  <span class="ruby-ivar">@settings</span> = <span class="ruby-constant">Settings</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;.bundle&quot;</span>).<span class="ruby-identifier">expand_path</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-setup" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">setup</span><span
                                class="method-args">(*groups)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Turns on the <a href="Bundler.html"><code>Bundler</code></a> runtime. After <code>Bundler.setup</code> call, all <code>load</code> or <code>require</code> of the gems would be allowed only if they are part of the Gemfile or Ruby’s standard library. If the versions specified in Gemfile, only those versions would be loaded.</p>

<p>Assuming Gemfile</p>

<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-string">&#39;first_gem&#39;</span>, <span class="ruby-string">&#39;= 1.0&#39;</span>
<span class="ruby-identifier">group</span> <span class="ruby-value">:test</span> <span class="ruby-keyword">do</span>
  <span class="ruby-identifier">gem</span> <span class="ruby-string">&#39;second_gem&#39;</span>, <span class="ruby-string">&#39;= 1.0&#39;</span>
<span class="ruby-keyword">end</span>
</pre>

<p>The code using <a href="Bundler.html#method-c-setup"><code>Bundler.setup</code></a> works as follows:</p>

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;third_gem&#39;</span> <span class="ruby-comment"># allowed, required from global gems</span>
<span class="ruby-identifier">require</span> <span class="ruby-string">&#39;first_gem&#39;</span> <span class="ruby-comment"># allowed, loads the last installed version</span>
<span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">setup</span>
<span class="ruby-identifier">require</span> <span class="ruby-string">&#39;fourth_gem&#39;</span> <span class="ruby-comment"># fails with LoadError</span>
<span class="ruby-identifier">require</span> <span class="ruby-string">&#39;second_gem&#39;</span> <span class="ruby-comment"># loads exactly version 1.0</span>
</pre>

<p><code>Bundler.setup</code> can be called only once, all subsequent calls are no-op.</p>

<p>If <em>groups</em> list is provided, only gems from specified groups would be allowed (gems specified outside groups belong to special <code>:default</code> group).</p>

<p>To require all gems from Gemfile (or only some groups), see <a href="Bundler.html#method-c-require"><code>Bundler.require</code></a>.</p>

                              <div class="method-source-code" id="setup-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 152</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">setup</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">groups</span>)
  <span class="ruby-comment"># Return if all groups are already loaded</span>
  <span class="ruby-keyword">return</span> <span class="ruby-ivar">@setup</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-ivar">@setup</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@setup</span>

  <span class="ruby-identifier">definition</span>.<span class="ruby-identifier">validate_runtime!</span>

  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">print_major_deprecations!</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">groups</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-comment"># Load all groups, but only once</span>
    <span class="ruby-ivar">@setup</span> = <span class="ruby-identifier">load</span>.<span class="ruby-identifier">setup</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">load</span>.<span class="ruby-identifier">setup</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">groups</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-specs_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">specs_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="specs_path-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 293</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">specs_path</span>
  <span class="ruby-identifier">bundle_path</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;specifications&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-system_bindir" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">system_bindir</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="system_bindir-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 475</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">system_bindir</span>
  <span class="ruby-comment"># Gem.bindir doesn&#39;t always return the location that RubyGems will install</span>
  <span class="ruby-comment"># system binaries. If you put &#39;-n foo&#39; in your .gemrc, RubyGems will</span>
  <span class="ruby-comment"># install binstubs there instead. Unfortunately, RubyGems doesn&#39;t expose</span>
  <span class="ruby-comment"># that directory at all, so rather than parse .gemrc ourselves, we allow</span>
  <span class="ruby-comment"># the directory to be set as well, via `bundle config set --local bindir foo`.</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:system_bindir</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">gem_bindir</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-tmp" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">tmp</span><span
                                class="method-args">(name = Process.pid.to_s)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="tmp-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 326</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tmp</span>(<span class="ruby-identifier">name</span> = <span class="ruby-constant">Process</span>.<span class="ruby-identifier">pid</span>.<span class="ruby-identifier">to_s</span>)
  <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">send</span>(<span class="ruby-value">:require</span>, <span class="ruby-string">&quot;tmpdir&quot;</span>)
  <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">mktmpdir</span>([<span class="ruby-string">&quot;bundler&quot;</span>, <span class="ruby-identifier">name</span>]))
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-ui" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ui</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ui-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 86</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ui</span>
  (<span class="ruby-keyword">defined?</span>(<span class="ruby-ivar">@ui</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@ui</span>) <span class="ruby-operator">||</span> (<span class="ruby-keyword">self</span>.<span class="ruby-identifier">ui</span> = <span class="ruby-constant">UI</span><span class="ruby-operator">::</span><span class="ruby-constant">Shell</span>.<span class="ruby-identifier">new</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-ui-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ui=</span><span
                                class="method-args">(ui)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ui-3D-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 90</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ui=</span>(<span class="ruby-identifier">ui</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">ui</span> = <span class="ruby-constant">UI</span><span class="ruby-operator">::</span><span class="ruby-constant">RGProxy</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ui</span>)
  <span class="ruby-ivar">@ui</span> = <span class="ruby-identifier">ui</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-unbundled_env" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">unbundled_env</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>@return [Hash] Environment with all bundler-related variables removed</p>

                              <div class="method-source-code" id="unbundled_env-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 367</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">unbundled_env</span>
  <span class="ruby-identifier">env</span> = <span class="ruby-identifier">original_env</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">env</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-string">&quot;BUNDLER_ORIG_MANPATH&quot;</span>)
    <span class="ruby-identifier">env</span>[<span class="ruby-string">&quot;MANPATH&quot;</span>] = <span class="ruby-identifier">env</span>[<span class="ruby-string">&quot;BUNDLER_ORIG_MANPATH&quot;</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">env</span>.<span class="ruby-identifier">delete_if</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">_</span><span class="ruby-operator">|</span> <span class="ruby-identifier">k</span>[<span class="ruby-value">0</span>, <span class="ruby-value">7</span>] <span class="ruby-operator">==</span> <span class="ruby-string">&quot;BUNDLE_&quot;</span> }

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">env</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-string">&quot;RUBYOPT&quot;</span>)
    <span class="ruby-identifier">rubyopt</span> = <span class="ruby-identifier">env</span>[<span class="ruby-string">&quot;RUBYOPT&quot;</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot; &quot;</span>)
    <span class="ruby-identifier">rubyopt</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-node">&quot;-r#{File.expand_path(&quot;bundler/setup&quot;, __dir__)}&quot;</span>)
    <span class="ruby-identifier">rubyopt</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-string">&quot;-rbundler/setup&quot;</span>)
    <span class="ruby-identifier">env</span>[<span class="ruby-string">&quot;RUBYOPT&quot;</span>] = <span class="ruby-identifier">rubyopt</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot; &quot;</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">env</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-string">&quot;RUBYLIB&quot;</span>)
    <span class="ruby-identifier">rubylib</span> = <span class="ruby-identifier">env</span>[<span class="ruby-string">&quot;RUBYLIB&quot;</span>].<span class="ruby-identifier">split</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_SEPARATOR</span>)
    <span class="ruby-identifier">rubylib</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">__dir__</span>)
    <span class="ruby-identifier">env</span>[<span class="ruby-string">&quot;RUBYLIB&quot;</span>] = <span class="ruby-identifier">rubylib</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_SEPARATOR</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">env</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-unbundled_exec" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">unbundled_exec</span><span
                                class="method-args">(*args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Run a ‘Kernel.exec` to a subcommand in an environment with all bundler related variables removed</p>

                              <div class="method-source-code" id="unbundled_exec-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 454</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">unbundled_exec</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
  <span class="ruby-identifier">with_env</span>(<span class="ruby-identifier">unbundled_env</span>) { <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">exec</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-unbundled_system" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">unbundled_system</span><span
                                class="method-args">(*args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Run subcommand in an environment with all bundler related variables removed</p>

                              <div class="method-source-code" id="unbundled_system-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 432</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">unbundled_system</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
  <span class="ruby-identifier">with_unbundled_env</span> { <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">system</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-use_system_gems-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">use_system_gems?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="use_system_gems-3F-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 488</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">use_system_gems?</span>
  <span class="ruby-identifier">configured_bundle_path</span>.<span class="ruby-identifier">use_system_gems?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-user_bundle_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">user_bundle_path</span><span
                                class="method-args">(dir = &quot;home&quot;)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="user_bundle_path-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 263</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">user_bundle_path</span>(<span class="ruby-identifier">dir</span> = <span class="ruby-string">&quot;home&quot;</span>)
  <span class="ruby-identifier">env_var</span>, <span class="ruby-identifier">fallback</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">dir</span>
                      <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;home&quot;</span>
                        [<span class="ruby-string">&quot;BUNDLE_USER_HOME&quot;</span>, <span class="ruby-identifier">proc</span> { <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">user_home</span>).<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;.bundle&quot;</span>) }]
                      <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;cache&quot;</span>
                        [<span class="ruby-string">&quot;BUNDLE_USER_CACHE&quot;</span>, <span class="ruby-identifier">proc</span> { <span class="ruby-identifier">user_bundle_path</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;cache&quot;</span>) }]
                      <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;config&quot;</span>
                        [<span class="ruby-string">&quot;BUNDLE_USER_CONFIG&quot;</span>, <span class="ruby-identifier">proc</span> { <span class="ruby-identifier">user_bundle_path</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;config&quot;</span>) }]
                      <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;plugin&quot;</span>
                        [<span class="ruby-string">&quot;BUNDLE_USER_PLUGIN&quot;</span>, <span class="ruby-identifier">proc</span> { <span class="ruby-identifier">user_bundle_path</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;plugin&quot;</span>) }]
                      <span class="ruby-keyword">else</span>
                        <span class="ruby-identifier">raise</span> <span class="ruby-constant">BundlerError</span>, <span class="ruby-node">&quot;Unknown user path requested: #{dir}&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-comment"># `fallback` will already be a Pathname, but Pathname.new() is</span>
  <span class="ruby-comment"># idempotent so it&#39;s OK</span>
  <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">ENV</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">env_var</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">fallback</span>))
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-user_cache" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">user_cache</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="user_cache-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 281</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">user_cache</span>
  <span class="ruby-identifier">user_bundle_path</span>(<span class="ruby-string">&quot;cache&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-user_home" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">user_home</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="user_home-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 239</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">user_home</span>
  <span class="ruby-ivar">@user_home</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
    <span class="ruby-identifier">home</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">user_home</span>
    <span class="ruby-identifier">bundle_home</span> = <span class="ruby-identifier">home</span> <span class="ruby-operator">?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">home</span>, <span class="ruby-string">&quot;.bundle&quot;</span>) <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>

    <span class="ruby-identifier">warning</span> = <span class="ruby-keyword">if</span> <span class="ruby-identifier">home</span>.<span class="ruby-identifier">nil?</span>
      <span class="ruby-string">&quot;Your home directory is not set.&quot;</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">home</span>)
      <span class="ruby-node">&quot;`#{home}` is not a directory.&quot;</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">writable?</span>(<span class="ruby-identifier">home</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">bundle_home</span>) <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">writable?</span>(<span class="ruby-identifier">bundle_home</span>))
      <span class="ruby-node">&quot;`#{home}` is not writable.&quot;</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">warning</span>
      <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;#{warning}\n&quot;</span>
      <span class="ruby-identifier">user_home</span> = <span class="ruby-identifier">tmp_home_path</span>
      <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;Bundler will use `#{user_home}&#39; as your home directory temporarily.\n&quot;</span>
      <span class="ruby-identifier">user_home</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">home</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-which" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">which</span><span
                                class="method-args">(executable)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="which-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 498</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">which</span>(<span class="ruby-identifier">executable</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">executable</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">executable?</span>(<span class="ruby-identifier">executable</span>)
    <span class="ruby-identifier">executable</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">paths</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;PATH&quot;</span>]
    <span class="ruby-identifier">quote</span> = <span class="ruby-string">&#39;&quot;&#39;</span>
    <span class="ruby-identifier">paths</span>.<span class="ruby-identifier">split</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_SEPARATOR</span>).<span class="ruby-identifier">find</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">path</span> = <span class="ruby-identifier">path</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">quote</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-identifier">quote</span>)
      <span class="ruby-identifier">executable_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">executable</span>, <span class="ruby-identifier">path</span>)
      <span class="ruby-keyword">return</span> <span class="ruby-identifier">executable_path</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">executable_path</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">executable?</span>(<span class="ruby-identifier">executable_path</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-with_clean_env" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">with_clean_env</span><span
                                class="method-args">() { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>@deprecated Use ‘with_unbundled_env` instead</p>

                              <div class="method-source-code" id="with_clean_env-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 398</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">with_clean_env</span>
  <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">major_deprecation</span>(
    <span class="ruby-value">2</span>,
    <span class="ruby-string">&quot;`Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. &quot;</span> \
    <span class="ruby-string">&quot;If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`&quot;</span>,
    <span class="ruby-value">:print_caller_location</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-keyword">true</span>
  )

  <span class="ruby-identifier">with_env</span>(<span class="ruby-identifier">unbundled_env</span>) { <span class="ruby-keyword">yield</span> }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-with_friendly_errors" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">with_friendly_errors</span><span
                                class="method-args">() { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="with_friendly_errors-source">
            <pre><span class="ruby-comment"># File bundler/friendly_errors.rb, line 115</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">with_friendly_errors</span>
  <span class="ruby-constant">FriendlyErrors</span>.<span class="ruby-identifier">enable!</span>
  <span class="ruby-keyword">yield</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">SignalException</span>
  <span class="ruby-identifier">raise</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span> <span class="ruby-comment"># rubocop:disable Lint/RescueException</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">FriendlyErrors</span>.<span class="ruby-identifier">disabled?</span>

  <span class="ruby-constant">FriendlyErrors</span>.<span class="ruby-identifier">log_error</span>(<span class="ruby-identifier">e</span>)
  <span class="ruby-identifier">exit</span> <span class="ruby-constant">FriendlyErrors</span>.<span class="ruby-identifier">exit_status</span>(<span class="ruby-identifier">e</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-with_original_env" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">with_original_env</span><span
                                class="method-args">() { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Run block with environment present before <a href="Bundler.html"><code>Bundler</code></a> was activated</p>

                              <div class="method-source-code" id="with_original_env-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 393</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">with_original_env</span>
  <span class="ruby-identifier">with_env</span>(<span class="ruby-identifier">original_env</span>) { <span class="ruby-keyword">yield</span> }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-with_unbundled_env" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">with_unbundled_env</span><span
                                class="method-args">() { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Run block with all bundler-related variables removed</p>

                              <div class="method-source-code" id="with_unbundled_env-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 410</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">with_unbundled_env</span>
  <span class="ruby-identifier">with_env</span>(<span class="ruby-identifier">unbundled_env</span>) { <span class="ruby-keyword">yield</span> }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Class Methods</h3>
                </header>

                  <div id="method-c-configure_gem_home" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">configure_gem_home</span><span
                                class="method-args">(path)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="configure_gem_home-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 640</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">configure_gem_home</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">set_env</span> <span class="ruby-string">&quot;GEM_HOME&quot;</span>, <span class="ruby-identifier">path</span>.<span class="ruby-identifier">to_s</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-configure_gem_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">configure_gem_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="configure_gem_path-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 631</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">configure_gem_path</span>
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">use_system_gems?</span>
    <span class="ruby-comment"># this needs to be empty string to cause</span>
    <span class="ruby-comment"># PathSupport.split_gem_path to only load up the</span>
    <span class="ruby-comment"># Bundler --path setting as the GEM_PATH.</span>
    <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">set_env</span> <span class="ruby-string">&quot;GEM_PATH&quot;</span>, <span class="ruby-string">&quot;&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-eval_gemspec" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">eval_gemspec</span><span
                                class="method-args">(path, contents)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="eval_gemspec-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 623</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">eval_gemspec</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">contents</span>)
  <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">contents</span>, <span class="ruby-constant">TOPLEVEL_BINDING</span>.<span class="ruby-identifier">dup</span>, <span class="ruby-identifier">path</span>.<span class="ruby-identifier">expand_path</span>.<span class="ruby-identifier">to_s</span>)
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">ScriptError</span>, <span class="ruby-constant">StandardError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-identifier">msg</span> = <span class="ruby-node">&quot;There was an error while loading `#{path.basename}`: #{e.message}&quot;</span>

  <span class="ruby-identifier">raise</span> <span class="ruby-constant">GemspecError</span>, <span class="ruby-constant">Dsl</span><span class="ruby-operator">::</span><span class="ruby-constant">DSLError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>, <span class="ruby-identifier">contents</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-eval_yaml_gemspec" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">eval_yaml_gemspec</span><span
                                class="method-args">(path, contents)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="eval_yaml_gemspec-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 615</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">eval_yaml_gemspec</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">contents</span>)
  <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">require</span> <span class="ruby-string">&quot;psych&quot;</span>

  <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Specification</span>.<span class="ruby-identifier">from_yaml</span>(<span class="ruby-identifier">contents</span>)
<span class="ruby-keyword">rescue</span> <span class="ruby-operator">::</span><span class="ruby-constant">Psych</span><span class="ruby-operator">::</span><span class="ruby-constant">SyntaxError</span>, <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">EndOfYAMLException</span>, <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Exception</span>
  <span class="ruby-identifier">eval_gemspec</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">contents</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-load_marshal" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">load_marshal</span><span
                                class="method-args">(data, marshal_proc: nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="load_marshal-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 609</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load_marshal</span>(<span class="ruby-identifier">data</span>, <span class="ruby-value">marshal_proc:</span> <span class="ruby-keyword">nil</span>)
  <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">marshal_proc</span>)
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">TypeError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">MarshalError</span>, <span class="ruby-node">&quot;#{e.class}: #{e.message}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-tmp_home_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">tmp_home_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="tmp_home_path-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 644</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tmp_home_path</span>
  <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">send</span>(<span class="ruby-value">:require</span>, <span class="ruby-string">&quot;tmpdir&quot;</span>)
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">path</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">tmp</span>
    <span class="ruby-identifier">at_exit</span> { <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rm_rf</span>(<span class="ruby-identifier">path</span>) }
    <span class="ruby-identifier">path</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-with_env" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">with_env</span><span
                                class="method-args">(env) { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>@param env [Hash]</p>

                              <div class="method-source-code" id="with_env-source">
            <pre><span class="ruby-comment"># File bundler.rb, line 654</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">with_env</span>(<span class="ruby-identifier">env</span>)
  <span class="ruby-identifier">backup</span> = <span class="ruby-constant">ENV</span>.<span class="ruby-identifier">to_hash</span>
  <span class="ruby-constant">ENV</span>.<span class="ruby-identifier">replace</span>(<span class="ruby-identifier">env</span>)
  <span class="ruby-keyword">yield</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-constant">ENV</span>.<span class="ruby-identifier">replace</span>(<span class="ruby-identifier">backup</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-URI" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">URI</span><span
                                class="method-args">(uri)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns <code>uri</code> converted to an <a href="Bundler/URI.html"><code>Bundler::URI</code></a> object.</p>

                              <div class="method-source-code" id="URI-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 718</span>
<span class="ruby-keyword">def</span> <span class="ruby-constant">URI</span>(<span class="ruby-identifier ruby-title">uri</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">Generic</span>)
    <span class="ruby-identifier">uri</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">uri</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">try_convert</span>(<span class="ruby-identifier">uri</span>)
    <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>,
      <span class="ruby-string">&quot;bad argument (expected Bundler::URI object or Bundler::URI string)&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

